<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>商品详情页</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.7.2/axios.js"></script>
  </head>
  <body>
    <div class="wrap">
      <!-- <img src="" />
      <p></p>
      <p></p>
      <p></p> -->
    </div>
  </body>
  <script>
    const http = axios.create({
      baseURL: "http://localhost:8888",
      setTimeout: 1000,
      headers: {
        "content-type": "application/json",
      },
    });
    function loadList(ID) {
      http
        .request({
          method: "get",
          url: "/goods/item/",
          params: {
            id: ID,
          },
        })
        .then((response) => {
          //   console.log(response);
          let item = response.data.info;
          console.log(item);
          document.querySelector(".wrap").innerHTML = `
                ${item.goods_introduce}
              `;
        });
    }
    loadList(sessionStorage.getItem("ID"));
    function reduceFn() {
      let ipt = document.querySelector("#ipt");
      //   console.log(ipt);
      ipt.value >= 0 ? ipt.value-- : (ipt.value = 0);
    }
  </script>
</html>
